<html>
	<head>
		<title>My Search Engine</title>
	</head>
	<body>
		<%@ page import="java.util.*" %>
		<form name="myform" action="http://localhost:8080/string/Crawler/src/MySearchEngine.jsp" method="post">
			<br></br>
			<div align="center"> 
				<font size="7"><b>My Search Engine</b></font size>
			</div>
			<br></br>
			<div class="section _100" align="center">
				<div>
					<input type="text" name="pencarian" size=75/>
				</div>
			</div>
			<div class="actions" style="padding-bottom: 5px; padding-top: 5px;" align="center">
				<div>
					<input type="submit" style="width: 50px" value="Cari"/>
				</div>
			</div>
			<br></br>
			<!--
			<div align="center">
				<a href="http://localhost:8080/string/Path.jsp">Path</a>
				<a href="http://localhost:8080/string/Algoritma.jsp">Algoritma</a>
				<a href="http://localhost:8080/string/OpsiPencarian.jsp">Opsi Pencarian</a>
				<a href="http://localhost:8080/string/Perihal.jsp">Perihal</a>
			</div>
			-->
			<div align="center">
				<font size="4"><b>Path</b></font size>
			</div>
			<div class="section _100" align="center">
				<div>
					<input type="text" name="pathpencarian" size=75/>
				</div>
			</div>
			<br></br>
			<div align="center">
				<font size="4"><b>Algoritma</b></font size>
			</div>
			<div align="center">
				<input type="radio" name="algoritma" value="KMP" checked="checked">KMP</input>
			</div>
			<div align="center">
				<input type="radio" name="algoritma" value="Boyer-Moore">Boyer-Moore</input>
			</div>
			<br></br>
			<div align="center">
				<font size="4"><b>Opsi Pencarian</b></font size>
			</div>
			<div align="center">
				<input type="radio" name="opsipencarian" value="Judul" checked="checked">Judul</input>
			</div>
			<div align="center">
				<input type="radio" name="opsipencarian" value="Judul+Isi">Judul+Isi</input>
			</div>
			<br></br>
			<div align="center">
				<a href="http://localhost:8080/string/Crawler/src/Perihal.jsp"><font size="4"><b>Perihal</b></font size></a>
			</div>
		</form>
		<%
			String keyWord = request.getParameter("pencarian");
			String path = request.getParameter("pathpencarian");
			String algorithm = request.getParameter("algoritma");
			String searchingOption = request.getParameter("opsipencarian");
			//if (pencarian!=null) && (pathpencarian!=null) && (algoritma!=null) && (opsipencarian!=null) {
				//Crawler crawl = new Crawler(pencarian,pathpencarian,algoritma,opsipencarian);
				//Result[] res = crawl.crawl();
				
				//for(Result ares : res) {
					//System.out.println("ketemu di " + ares.getPath() + " preview : " + ares.getPreview());
				//}
			//}
			
			
			if (keyWord!=null) {
				out.println(keyWord);
				out.println(path);
				out.println(algorithm);
				out.println(searchingOption);
			}
			
		%>
	</body>
</html>
